{% extends 'xadmin/base_site.html' %}
{% load i18n xadmin_tags %}

{% block content %}

    {% block content-nav %}

    {% endblock %}
    <div class="navbar content-navbar navbar-default navbar-xs" data-toggle="breakpoint"
         data-class-xs="navbar content-navbar navbar-inverse navbar-xs"
         data-class-sm="navbar content-navbar navbar-default navbar-xs">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle pull-left" onclick="javascript: history.back();"><i
                    class="fa fa-arrow-left"></i></button>
            <a class="navbar-brand" data-toggle="collapse" data-target="#top-nav .navbar-collapse">
                <i class="fa fa-phone&#39;"><sub class="fa fa-plus"></sub></i>增加 SIP用户
            </a>
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
            </ul>
            <div class="navbar-btn pull-right hide-xs">
            </div>
        </div>
    </div>
<form class="exform" {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form">{% csrf_token %}
{% if errors %}
      <div class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
      {% blocktrans count counter=errors|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
      </div>
      {{ form.non_field_errors }}

  {% endif %}
        <div class="form-container row clearfix">
            <div id="column-0"
                 class="formColumn column form-column full col col-sm-12 form-horizontal" span="12" horizontal>
                <div class="panel panel-default fieldset unsort no_title" id="box-0">
                    <div class="panel-heading"><i class='icon fa fa-chevron-up chevron'></i>
                        <h3 class="panel-title"></h3></div>
                    <div class="panel-body ">
                        <div id="div_id_dn" class="form-group {% if form.dn.errors %} has-error{% endif %}"><label for="id_dn" class="control-label  requiredField">
                            号码<span class="asteriskField">*</span> </label>
                            <div class="controls ">
                                <input class="int-field adminintegerfieldwidget form-control" id="id_dn" name="dn" type="text" {% if form.dn.value %}value="{{ form.dn.value }}"{% endif %} />
                            {% if form.dn.errors %}<span id="error_1_id_dn" class="help-block"><strong>{{ form.dn.errors }}</strong></span>{% endif %}
                            </div>
                        </div>

                        <div id="div_id_number" class="form-group {% if form.number.errors %} has-error{% endif %}"><label for="id_number"
                                                                          class="control-label  requiredField">
                            放号数<span class="asteriskField">*</span> </label>
                            <div class="controls ">
                                <input class="int-field adminintegerfieldwidget form-control"
                                                          id="id_number" name="number" type="text" {% if form.number.value %}value="{{ form.number.value }}"{% endif %}/>
                            {% if form.number.errors %}<span id="error_1_id_number" class="help-block"><strong>{{ form.number.errors }}</strong></span>{% endif %}
                            </div>
                        </div>
                        <div id="div_id_password" class="form-group {% if form.password.errors %} has-error{% endif %}"><label for="id_password"
                                                                            class="control-label  requiredField">
                            密码<span class="asteriskField">*</span> </label>
                            <div class="controls ">
                                <input class="text-field admintextinputwidget form-control"
                                                          id="id_password" maxlength="32" name="password" type="text"
                                                          {% if form.password.value %}value="{{ form.password.value }}"{% endif %}/>
                            {% if form.password.errors %}<span id="error_1_id_pawwsword" class="help-block"><strong>{{ form.password.errors }}</strong></span>{% endif %}
                            </div>
                        </div>
                        <div id="div_id_vm_password" class="form-group"><label for="id_vm_password"
                                                                               class="control-label ">
                            Vm-密码
                        </label>
                            <div class="controls "><input class="text-field admintextinputwidget form-control"
                                                          id="id_vm_password" maxlength="16" name="vm_password"
                                                          type="text"/></div>
                        </div>
                        <div id="div_id_toll_allow" class="form-group"><label for="id_toll_allow"
                                                                              class="control-label  requiredField">
                            权限</label>
                            <div class="controls ">
                                <input name="toll_allow" type="checkbox" value="international"/>国际
                               <input name="toll_allow" type="checkbox" value="domestic"/>国内
                               <input name="toll_allow" type="checkbox" value="local"/>本地
                                <input name="toll_allow" type="checkbox" value="INTER"/>局内
                             </div>
                        </div>
                        <div id="div_id_accountcode" class="form-group"><label for="id_accountcode"
                                                                               class="control-label ">
                            计费号码
                        </label>
                            <div class="controls "><input class="text-field admintextinputwidget form-control"
                                                          id="id_accountcode" maxlength="32" name="accountcode"
                                                          type="text"/></div>
                        </div>
                        <div id="div_id_user_context" class="form-group {% if form.user_context.errors %} has-error{% endif %}"><label for="id_user_context"
                                                                                class="control-label  requiredField">
                            User_context<span class="asteriskField">*</span> </label>
                            <div class="controls ">
                                <input class="text-field admintextinputwidget form-control"
                                                          id="id_user_context" maxlength="32" name="user_context"
                                                          type="text" {% if form.user_context.value %}value="{{ form.user_context.value }}"{% endif %}/></div>
                        {% if form.user_context.errors %}<span id="error_1_id_user_context" class="help-block"><strong>{{ form.user_context.errors }}</strong></span>{% endif %}
                        </div>
                        <div id="div_id_effective_caller_id_name" class="form-group"><label
                                for="id_effective_caller_id_name" class="control-label ">
                            用户名
                        </label>
                            <div class="controls "><input class="text-field admintextinputwidget form-control"
                                                          id="id_effective_caller_id_name" maxlength="32"
                                                          name="effective_caller_id_name" type="text"/></div>
                        </div>
                        <div id="div_id_effective_caller_id_number" class="form-group"><label
                                for="id_effective_caller_id_number" class="control-label ">
                            显示号码
                        </label>
                            <div class="controls "><input class="text-field admintextinputwidget form-control"
                                                          id="id_effective_caller_id_number" maxlength="32"
                                                          name="effective_caller_id_number" type="text"/></div>
                        </div>
                        <div id="div_id_outbound_caller_id_name" class="form-group {% if form.outbound_caller_id_name.errors %} has-error{% endif %}"><label
                                for="id_outbound_caller_id_name" class="control-label  requiredField">
                            出站用户名<span class="asteriskField">*</span> </label>
                            <div class="controls ">
                                <input class="text-field admintextinputwidget form-control"
                                                          id="id_outbound_caller_id_name" maxlength="32"
                                                          name="outbound_caller_id_name" type="text"
                                                          {% if form.outbound_caller_id_name.value %}value="{{ form.outbound_caller_id_name.value }}"{% endif %}/>
                            {% if form.outbound_caller_id_name.errors %}<span id="error_1_id_outbound_caller_id_name" class="help-block"><strong>{{ form.outbound_caller_id_name.errors }}</strong></span>{% endif %}
                            </div>
                        </div>
                        <div id="div_id_outbound_caller_id_number" class="form-group {% if form.outbound_caller_id_number.errors %} has-error{% endif %}"><label
                                for="id_outbound_caller_id_number" class="control-label  requiredField">
                            出站号码<span class="asteriskField">*</span> </label>
                            <div class="controls "><input class="text-field admintextinputwidget form-control"
                                                          id="id_outbound_caller_id_number" maxlength="32"
                                                          name="outbound_caller_id_number" type="text"
                                                           {% if form.outbound_caller_id_number.value %}value="{{ form.outbound_caller_id_number.value }}"{% endif %} />
                                {% if form.outbound_caller_id_number.errors %}<span id="error_1_id_outbound_caller_id_number" class="help-block"><strong>{{ form.outbound_caller_id_number.errors }}</strong></span>{% endif %}
                            </div>
                        </div>
                        <div id="div_id_callgroup" class="form-group {% if form.callgroup.errors %} has-error{% endif %}"><label for="id_callgroup"
                                                                             class="control-label  requiredField">
                            呼叫组<span class="asteriskField">*</span> </label>
                            <div class="controls ">
                                <input class="text-field admintextinputwidget form-control"
                                                          id="id_callgroup" maxlength="32" name="callgroup" type="text"
                                                          {% if form.callgroup.value %}value="{{ form.callgroup.value }}"{% endif %} />
                            {% if form.callgroup.errors %}<span id="error_1_id_callgroup" class="help-block"><strong>{{ form.callgroup.errors }}</strong></span>{% endif %}
                            </div>
                        </div>
                           <div id="div_id_TIMEOUT" class="form-group {% if form.TIMEOUT.errors %} has-error{% endif %}"><label for="id_TIMEOUT"
                                                                          class="control-label  requiredField">
                            超时(秒)<span class="asteriskField">*</span> </label>
                            <div class="controls "><input class="int-field adminintegerfieldwidget form-control"
                                                          id="id_TIMEOUT" name="TIMEOUT" type="text" {% if form.TIMEOUT.value %}value="{{ form.TIMEOUT.value }}"{% endif %}/>
                                {% if form.TIMEOUT.errors %}<span id="error_1_id_TIMEOUT" class="help-block"><strong>{{ form.TIMEOUT.errors }}</strong></span>{% endif %}
                            </div>
                        </div>
                        <div id="div_id_onfail" class="form-group"><label for="id_onfail"
                                                                              class="control-label">
                            转移条件</label>
                            <div class="controls ">
                                <input name="onfail" type="checkbox" value="unconditional"/>无条件
                               <input name="onfail" type="checkbox" value="USER_NOT_REGISTERED,NORMAL_TEMPORARY_FAILURE,NO_ROUTE_DESTINATION"/>离线转移
                               <input name="onfail" type="checkbox" value="USER_BUSY"/>遇忙转
                                <input name="onfail" type="checkbox" value="TIMEOUT"/>超时转
                                <input name="onfail" type="checkbox" value="NO_ANSWER"/>无应答转
                             </div>
                        </div>
                         <div id="div_id_failnum" class="form-group"><label
                                for="id_failnum" class="control-label ">
                            转移号码
                        </label>
                            <div class="controls "><input class="text-field admintextinputwidget form-control"
                                                          id="id_failnum" maxlength="100"
                                                          name="failnum" type="text" {% if form.failnum.value %}value="{{ form.failnum.value }}"{% endif %}/></div>
                        </div>
                    </div>
                </div>

            </div>

        </div>


        <div class="form-actions well well-sm clearfix">


            <div class="btn-group clearfix show-xs save-group col-xs-12">
                <button type="submit" class="default btn btn-primary col-xs-10" name="_save" data-loading-text="保存中.."/>
                <i class="fa fa-save"></i> 保存</button>
                <button type="button" class="more btn btn-primary col-xs-2" data-toggle="collapse"
                        data-target=".nav-collapse.more-btns"><i class="fa fa-ellipsis-vertical"></i></button>
            </div>
            <button type="submit" class="default btn btn-primary hide-xs" name="_save" data-loading-text="保存中.."/>
            <i class="fa fa-save"></i> 保存</button>
            <div class="nav-collapse collapse more-btns">
                <input type="submit" class="btn btn-default" value="保存并增加另一个" name="_addanother"/>
                <input type="submit" class="btn btn-default" value="保存并继续编辑" name="_continue"/>
            </div>


        </div>
    </form>
{% endblock %}